package kr.poturns.blink.internal.comm;

import kr.poturns.blink.internal.DeviceAnalyzer;
import android.bluetooth.BluetoothDevice;

/**
 * 
 * @author Yeonho.Kim
 * @since 2014.07.26
 *
 */
public class BluetoothDeviceX{

	// *** CONSTANT DECLARATION *** //
	public static final int SOURCE_CLASSIC = 1;
	public static final int SOURCE_LE = 2;
	public static final int SOURCE_BOTH = 3;
	
	
	// *** FIELD DECLARATION *** //
	private final BluetoothDevice DEVICE;
	private int Source; 
	private boolean AutoConnect;
	private boolean Secure;
	
	public BluetoothDeviceX(BluetoothDevice device) {
		this.DEVICE = device;
		
		// - Default Setting
		DeviceAnalyzer mAnalyzer = DeviceAnalyzer.getInstance(null);
		if (mAnalyzer == null) {
			AutoConnect = true;
			Secure = ((Source & SOURCE_CLASSIC) == 0) && true;
			
		} else {
			//mAutoConnect = mAnalyzer.getAnalysis(key)
		}
	}

	public BluetoothDevice getDevice() {
		return DEVICE;
	}
	
	public void setSource(int source) {
		this.Source = source;
	}
	
	public int getSource() {
		return Source;
	}

	public void setAutoConnect(boolean auto) {
		this.AutoConnect = auto;
	}
	
	public boolean getAutoConnect() {
		return AutoConnect;
	}

	public void setSecure(boolean secure) {
		this.Secure = secure;
	}
	
	public boolean getSecure() {
		return ((Source & SOURCE_CLASSIC) == 0) && Secure;
	}
	
}
